Defining a mode that differs significantly from the default one
can get rather cumbersome. For convenience, allow mode definitions
to inherit from an existing mode.
https://bugzilla.gnome.org/show_bug.cgi?id=689308
const _modes = {
'restrictive': {
+ parentMode: null,
hasOverview: false,
showCalendarEvents: false,
allowSettings: false,
_sync: function() {
let params = this._modes[this.currentMode];
- params = Params.parse(params, this._modes[DEFAULT_MODE]);
+ let defaults;
+ if (params.parentMode)
+ defaults = Params.parse(this._modes[params.parentMode],
+ this._modes[DEFAULT_MODE]);
+ else
+ defaults = this._modes[DEFAULT_MODE];
+ params = Params.parse(params, defaults);
// A simplified version of Lang.copyProperties, handles
// undefined as a special case for "no change / inherit from previous mode"